<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrganizeLevelsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('organize_levels', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('organize_level_num', 18)->comment('组织编码');
            $table->string('organize_level_name')->comment('组织等级名');
            $table->string('organize_level_desc')->comment('组织等级描述');
            $table->string('p_organize_level_num', 18)->comment('组织上级组织');
            $table->unique('organize_level_num');
            $table->index('organize_level_name');
            $table->index('p_organize_level_num');
            $table->timestamps();
            $table->softDeletes();
            $table->engine = "InnoDB";
            $table->charset = 'utf8mb4';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('organize_levels');
    }
}
